home *** CD-ROM | disk | FTP | other *** search
/ Trading on the Edge / Trading On The Edge - CD-ROM Toolkit (Wayzata Technology)(2031)(1994).bin / pc / mac_file / vendor_d / neuralwa / nw2v50 / grnn.ind < prev    next >
File List  |  1993-08-23  |  4KB  |  240 lines

  1. inst4.1
  2. !****************************************************************
  3. !*                                *
  4. !*    General Regresion Neural Network Builder        *
  5. !*                                *
  6. !****************************************************************
  7. !
  8. ?&In    1
  9. >bge    ChkProto
  10. @Err    "General Regression Neural Networks MUST have at least one input PE"
  11. :ChkProto
  12. ?&Prt    1
  13. >bge    CheckOut
  14. @Err    "General Regression Neural Networks MUST have at least one output PE"
  15. :CheckOut
  16. ?&Out    1
  17. >bge    OutOK
  18. @Err    "General Regression Neural Networks  MUST have at least one pattern unit"
  19. :OutOK
  20.  
  21. !    *** Load the Control Strategy and schedules ***
  22. @LdCS    "grnn"
  23.  
  24. =netn "Untitled"
  25. =DLnF    0            !learn  re-display off
  26. =DRcF    0            !recall re-display off
  27.  
  28. !    *** Build the Input Layer ***
  29.  
  30. @LLdf                !load default layer to menu area
  31. =LDln    "In"            !layer name
  32. =Lpes    &In            !copy # of input PEs from menu
  33. =x    100            !place to put layer on screen
  34. =y     40
  35. @LDfW                !Default # weight fields
  36. @LAdd                !add the input layer
  37.  
  38. !    *** Build a Projection Layer if projection summation  ***
  39.  
  40. ?RBFS    2            !Projection summation?
  41. >bne    ProjL1            !No
  42.  
  43. #Incl   "proj_lyr.iif"
  44.  
  45. :ProjL1
  46. !
  47. =n6    LayN            !previous layer
  48. !
  49. ! Build Pattern layer
  50. !
  51. @LLdf                !start with default layer again
  52. =LDln    "Pattern"        !layer name
  53. =Lpes    &Prt            !Number of PEs
  54. ! Summation function
  55. ?RBFS    1            !City-Block?
  56. >bne    Sum1
  57. =Lsum    "City-Block"
  58. >br    SumEnd
  59. :Sum1
  60. ?RBFS    2            !Projection?
  61. >bne    Sum2
  62. =Lsum    "Sum"            !standard summation
  63. >br    SumEnd
  64. :Sum2                !Default
  65. =Lsum    "Euclidean"
  66. :SumEnd
  67.  
  68. =Ltrn    "Linear"
  69. =Llrn    "K-Means"
  70. =Lerf    "standard"
  71. =Ltrn    "GRNN"
  72. =Lcmp    "Select"
  73. ! Set up schedule
  74. @NLRS    "grnn"
  75. =lcta    99999
  76. ! Learning Rate
  77. =ArrX    1
  78. =lcft    "No Recode"
  79. =lcfa    0.0
  80. ! Radius of Influence
  81. =ArrX    2
  82. =lcft    "Cluster Radius"
  83. =lcfa    RInf
  84. ! Sigma Scale
  85. =ArrX    5
  86. =rcfa    SgSc
  87. =rcft    "Sigma Scale"
  88. ! Sigma Gain
  89. =ArrX    6
  90. =rcfa    SgEx
  91. =rcft    "Sigma Exponent"
  92. @SLRS
  93. =ArrX    0
  94. =Llrs    "grnn"
  95.  
  96. =LInH    0.1
  97. =LInL    -0.1
  98. +y    60            !up higher on display
  99. @LDfW                !Default # weight fields
  100. @LAdd
  101.  
  102. ! Connect input layer to pattern layer
  103.  
  104. =cnwt    1.0
  105. =cnty    WVar            !Variable
  106. =cnsc    WRel            !Relative
  107. =SPEl    LayN            !destination layer
  108. @SlPE                !select as destination
  109. =NPEl    n6            !source layer
  110. @NrPE                !select as source
  111. @LCFl                !full connections
  112.  
  113. =n6    LayN            !pattern layer
  114.  
  115. ! Build Summation layer. First PE in summation layer
  116. ! is the divisor.
  117. @LLdf                !start with default layer again
  118. =LDln    "Summation"
  119. =Lpes    1            !Number of PEs
  120. +Lpes    &Out
  121. =Lcmp    "Divide"
  122. =Lerf    "standard"
  123. =Ltrn    "Linear"
  124. =Llrn    "GRNN"
  125. ! Set up schedule
  126. @NLRS    "grnnsum"
  127. =lcta    99999
  128. =ArrX    1
  129. =lcft    "1.0 / tau"
  130. ?TimC    1.0
  131. >bge    TimCOK
  132. =TimC    1.0
  133. :TimCOK
  134. =lcfa    1.0
  135. /lcfa    TimC
  136. ! Reset Factor
  137. =ArrX    2
  138. =lcft    "Reset Factor"
  139. =lcfa    PrRs
  140. @SLRS
  141. =ArrX    0
  142. =Llrs    "grnnsum"
  143. =LInH    0.0
  144. =LInL    0.0
  145. +y    60            !up higher on display
  146. @LDfW                !Default # weight fields
  147. @LAdd
  148.  
  149. ! Now do connections.
  150. =cnwt    1.0
  151. =cnty    WVar            !Variable
  152. =cnsc    WRel            !Relative
  153. =SPEl    LayN            !Summation Layer
  154. @SlPE
  155. =NPEl    n6            !Previous layer
  156. @NrPE
  157. @LCFl                !Full Connections
  158.  
  159. =n6    LayN            !summation layer
  160.  
  161. ! Output layer
  162. @LLdf                !start with default layer again
  163. =LDln    "Out"            !layer name
  164. =Lpes    &Out            !Number of PEs
  165. =Ltrn    "Linear"
  166. =Lerf    "standard"
  167. =LInH    1.0
  168. =LInL    1.0
  169. +x    50
  170. +y    60
  171. @LAdd
  172.  
  173. ! Fixed corresponding connections from Summation layer
  174. ! starting at second PE
  175. =cnwt    1.0
  176. =cnty    WFix            !Fixed
  177. =cnsc    WRel            !Relative
  178. !Destination layer:
  179. =SPEl    LayN
  180. =SPEn    0
  181. !Source Layer
  182. =NPEl    n6            !summation layer
  183. =NPEn    1            !start at 2nd PE
  184. :OutCn
  185. @SlPE
  186. @NrPE
  187. @PCon                !connect two PEs together
  188. +SPEn    1            !next PE in output layer
  189. ?SPEn    &Out            !past the end?
  190. >bge    OutCnEnd
  191. +NPEn    1            !next PE in the competitive layer
  192. >br    OutCn
  193.  
  194. :OutCnEnd
  195.  
  196. =LnPr    0            !no pruning
  197.  
  198. !    *** Select Control Strategy & L/R Schedule ***
  199.  
  200. @LLsl                !load super layer
  201.  
  202. !
  203. ! I/O parameters:
  204. !
  205. =Llnn    "train"            !name of learn input
  206. =Lrcn    "test"            !name of recall output
  207. #Incl    "stdioset.iif"        !standard I/O settings
  208. =Lax1    Epch            !set epoch from dialog
  209. ! Target ranges for MinMax tables
  210. =Lscl    -1.0            !input  low-value
  211. =Loff    1.0            !input  high-value
  212. =Llow    0.0            !output low-value
  213. =Lhgh    1.0            !output high-value
  214.  
  215. !    *** Load the Control Strategy and schedules ***
  216. =Lctl    "grnn"
  217. =GrLF    "grnn"            !Instrument List file
  218. =Llio    1            !Ascii, sequential
  219. @SVsl                !save it back
  220. !
  221. ! Miscellaneous globals
  222. =Grph     1            !Activate instrument list
  223. =jogl    -.1            !lower limit for jog
  224. =jogh    +.1            !upper limit for jog
  225. =seed    257            !starting seed number
  226. @seed                !set the seed
  227. !
  228. ! Recall/Test modes
  229. =RnTm    1
  230. =RnRm    1
  231. !set to learn one pass/all
  232. =RnLm    1
  233. !
  234. !
  235. ! Initialize the network
  236. !
  237. @Nini
  238. @EOF
  239.  
  240.